package com.mercator.client.graph;

import java.util.Collection;
import java.util.Iterator;

public abstract class Container<T extends Comparable<? super T>, N extends Node<? extends T,? super N>> implements Iterable<N> {
	
	public abstract void addEdge(T w, T v);
	public String toString(){
		String s = "";
		for(N n: this)
			s+=n + "\n";
		return s;
	}

	public abstract void remove(T t);

	public  Iterator<N> iterator(){
		return getNodes().iterator();
	}

	public abstract Iterable<T> getVals();

	public abstract Collection<N> getCol();

	public abstract Iterable<N> getNodes();

	public abstract void  connect(T elem1, T elem2);

	public abstract void  connect(N elem1, N elem2);

	public abstract void removeAll();

	public abstract  void add(N n);
	
	public void addAll(Collection<N> col){
		for(N n : col)
			this.add(n);
	}
	
	public abstract N find(N n);
	
	public abstract N find(T t);
	
	public abstract Collection<T> getValCol();
}
